const log4js = require('koa-log4');
const logger = log4js.getLogger('services::file');
const bson = require('bson');
const DBRef = bson.DBRef;
const helper = require('mongoskin').helper;
const db = require('../mongodb');

const insert = async (file) => {
	return new Promise((resolve, reject) => {
		db.file.insert(file, async (err, result) => {
			if (!err) {
				resolve(result);
			} else {
				reject(err);
			}
		});
	});
};

exports = module.exports = {
	insert
};